package com.ultrapower.ctool.utils;

import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.Window;
import android.view.WindowManager;

public class screen_oper {
	
	public static int SCREEN_WIDTH;
	public static int SCREEN_HEIGHT;
	public static int SCREEN_DPI;

	public static void set_full_screen(Activity activity){
		
		screen_oper.noTitleBar(activity);
    	//	screen_oper.noNotificationBar(activity); 

		CloseActivity.add(activity);
	}
	public static void noTitleBar(Activity activity)
	{
		activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
	}

	public static void noNotificationBar(Activity activity)
	{
		final Window win = activity.getWindow();
		win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
	}
	
	/**
	 * 获取屏幕尺寸
	 */
	public static void initScreenData(Activity activity) {
		DisplayMetrics dm = new DisplayMetrics();
		activity.getWindowManager().getDefaultDisplay().getMetrics(dm);

		SCREEN_WIDTH = dm.widthPixels;//获取屏幕宽度
		SCREEN_HEIGHT = dm.heightPixels;//获取屏幕高度
		SCREEN_DPI = dm.densityDpi; //获取像素密度
		
	}
}
